﻿namespace Leetcode.N0905;
public class Solution
{
    public int[] SortArrayByParity(int[] nums)
    {
        int moveFrom = 0;

        for (int i = 0; i < nums.Length; i++)
        {
            if (nums[i] % 2 == 0)
            {
                var t = nums[moveFrom];
                nums[moveFrom] = nums[i];
                nums[i] = t;
                moveFrom++;
            }
        }
        return nums;
    }
}